package pt.mauromad.guias.dao;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import pt.mauromad.guias.dao.generic.GenericProductDao;

@Entity
@Table(name = "product")
public class ProductDao extends GenericProductDao {
	private AccountDao account;
	private boolean enabled = true;

	@ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY, optional = false)
	@JoinColumn(name = "account_id", nullable = false, updatable = false, insertable = true)
	public AccountDao getAccount() {
		return account;
	}

	public void setAccount(AccountDao account) {
		this.account = account;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
}
